<template>
  <div class="page-container">
    <!--表格内容栏-->
    <ac-table
      ref="dataTable"
      pkName="id"
      :filters="filters"
      :filterFields="filterFields"
      :columns="columns"
      :defaultSort="defaultSort"
    ></ac-table>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import tool from "@/utils/tool";

const filters = ref({
  beanName: '',
  methodName: ''
});
const filterFields = ref([
  {prop: "businessType", label: "业务类型", type: 'select', options: "脚本,采集任务"},
  {prop: "businessName", label: "业务名称"},
  {prop: "status", label: "状态", type: 'select', options: '执行中,执行成功,执行失败'},
]);
const columns = ref([
  {prop: "businessType", label: "业务类型", minWidth: 120},
  {prop: "businessName", label: "业务名称", minWidth: 120},
  {prop: "params", label: "参数", minWidth: 100},
  {prop: "status", label: "状态", width: 100, type: 'select', options: '执行中,执行成功,执行失败'},
  {prop: "startTime", label: "开始时间", width: 160, type: "datetime"},
  {prop: "endTime", label: "结束时间", width: 160, type: "datetime"},
  {prop: "timeConsume", label: "执行时间", minWidth: 120, align: 'right', formatter: (prop, value) => tool.formatTime(value)},
  {prop: "errorMessage", label: "失败信息", minWidth: 120},
  {prop: "createTime", label: "创建时间", width: 160, type: "datetime"}
]);
const defaultSort = ref({prop: 'createTime', order: 'descending'});
</script>